package net.bluemind.ysnp;

/**
 * A factory to create password validators. Its primary usage is to retain
 * global objects shared by all {@link ICredentialValidator}.
 * 
 * For example reference to a connection pool used for validation should be kept
 * in implementors of {@link ICredentialValidatorFactory}.
 * 
 * @author tom
 * 
 */
public interface ICredentialValidatorFactory {

	/**
	 * @return a validator
	 */
	ICredentialValidator getValidator();

	/**
	 * eg. ldap or obm-ticket
	 * 
	 * @return
	 */
	String getName();

	/**
	 * Defines execution order when several factories are in use.
	 * 
	 * <code>0</code> means : Top Priority, runs first.
	 * <code>Integer.MAX_VALUE</code> means : low priority, run last.
	 * 
	 * @return the run priority
	 */
	int getPriority();

	/**
	 * Initializes the factory parameters with the shared configuration values
	 * 
	 * @param conf
	 */
	void init(YSNPConfiguration conf);

}
